home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-04 | 3.6 KB | 115 lines | [TEXT/KAHL] |
- /***************************************************** IMPLEMENTATION
- DATE: 10/19/93
-
- CLASS: CPPScrollWindow
-
- SUPERCLASS: CPPWindow, CPPScrollArea
-
- This C++ class manages a window which has a scrolling area
- inside of it
-
- ********************************************************************/
-
- #include <CPPScrollWindow.h>
- #include <Commands.h>
- #include <MathTools.h>
-
-
- /*-----------------------------------------------------------------*/
- /*------------------------ PUBLIC METHODS -------------------------*/
- /*-----------------------------------------------------------------*/
-
- CPPScrollWindow::CPPScrollWindow (CPPWindowManager *theManager, int ResID,
- Boolean HScroll, Boolean VScroll,
- short hStep, short vStep) :
- CPPWindow (theManager, ResID),
- CPPScrollArea ((CPPWindow *)this, HScroll, VScroll,
- hStep, vStep)
- /* most of the work is done in the initialization phase */
- {
- SetMinMaxSize(70, 70, kPageWidth + kSBarWidth,
- kPageHeight + kSBarWidth);
- }
-
- /*-----------------------------------------------------------------*/
-
- CPPScrollWindow::CPPScrollWindow (CPPWindowManager *theManager,
- Rect *bounds, StringPtr title, Boolean isVisible,
- int windowKind, Boolean hasGoAway, int RefCon,
- Boolean HScroll, Boolean VScroll,
- short hStep, short vStep) :
- CPPWindow (theManager, bounds, title, isVisible,
- windowKind, hasGoAway, RefCon),
- CPPScrollArea ((CPPWindow *)this, HScroll, VScroll,
- hStep, vStep)
- /* most of the work is done in the initialization phase */
- {
- SetMinMaxSize(70, 70, kPageWidth + kSBarWidth,
- kPageHeight + kSBarWidth);
- }
-
- /*-----------------------------------------------------------------*/
-
- CPPScrollWindow::~CPPScrollWindow (void)
- {
-
- }
-
- /*-----------------------------------------------------------------*/
-
- char *CPPScrollWindow::ClassName (void)
- {
- return "CPPScrollWindow";
- }
-
- /*-----------------------------------------------------------------*/
-
- Boolean CPPScrollWindow::DoCommand (short commandID)
- /* the default method sends the command to the target of the */
- /* window. */
- /* SUBCLASS SHOULD OVERRIDE */
- {
- return CPPScrollArea::DoCommand(commandID);
- }
-
- /*-----------------------------------------------------------------*/
- /*---------------------- PROTECTED METHODS ------------------------*/
- /*-----------------------------------------------------------------*/
-
- void CPPScrollWindow::DoUserClick (EventRecord *theEvent)
- /* instance specific handler for clicking in the window */
- /* SUBCLASS SHOULD OVERRIDE */
- {
- CPPScrollArea::DoClick (theEvent); // scrollarea object method
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPScrollWindow::DoUserUpdate (void)
- /* instance specific handler for drawing the window's contents */
- /* SUBCLASS SHOULD OVERRIDE */
- {
- this->Draw(); // scrollarea object method
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPScrollWindow::DoUserIdle (void)
- /* instance specific handler for idling when the window is */
- /* the frontmost window */
- /* SUBCLASS SHOULD OVERRIDE */
- {
- if (this->WisActive)
- CPPScrollArea::DoIdle(); // textedit object method
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPScrollWindow::DoUserChangeSize (short newWidth, short newHeight)
- /* instance specific handler for resizing the window; use this */
- /* opportunity to change the size of the scrollbars and TE area */
- {
- CPPScrollArea::Resize (newWidth, newHeight); // textedit object method
- }
-
-